package com.riant;

import org.springframework.context.annotation.AnnotationConfigApplicationContext;

import javax.sql.DataSource;

public class App {
    public static void main(String[] args) {
        AnnotationConfigApplicationContext annotationConfigApplicationContext = new AnnotationConfigApplicationContext(AppConfig.class);

        DataSource dataSource=(DataSource)annotationConfigApplicationContext.getBean("pooledDataSource");
        DataSource dataSource2=(DataSource)annotationConfigApplicationContext.getBean("pooledDataSource");
        DataSource dataSource3=(DataSource)annotationConfigApplicationContext.getBean("pooledDataSource");
        DataSource dataSource4=(DataSource)annotationConfigApplicationContext.getBean("dataSource");
        System.out.println(dataSource.toString());
        System.out.println(dataSource2.toString());
        System.out.println(dataSource3.toString());
        System.out.println(dataSource4.toString());
    }
}
